package com.example.yxjdemo.com.yxj.config;

import com.example.yxjdemo.com.yxj.domain.User;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@EnableConfigurationProperties(YxjAutoConfigProperties.class)
public class YxjAutoConfig {

    @Bean
    public User getUser(YxjAutoConfigProperties yxjAutoConfigProperties) {

        return new User(yxjAutoConfigProperties.getName(), yxjAutoConfigProperties.getAge());
    }

}
